package com.ruoyi.recycle.dto;

import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 回收订单对象 recycle_order
 *
 * @author ruoyi
 * @date 2022-05-22
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class RecycleOrderDTO {
    private static final long serialVersionUID = 1L;

    /**
     * 订单号
     */
    @ApiModelProperty(name = "recycleOrderNo",value = "回收订单号",dataType = "String")
    private String recycleOrderNo;

    /**
     * 联系方式
     */
    @ApiModelProperty(name = "phone", value = "联系方式", dataType = "String")
    @TableField(whereStrategy = FieldStrategy.NOT_EMPTY)
    private String phone;

    /**
     * 上门时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(name = "visitTime",value = "上门时间",dataType = "Date",notes = "yyyy-MM-dd HH:mm:dd")
    private Date visitTime;

    /**
     * 取件地址
     */
    @ApiModelProperty(name = "address",value = "取件地址",dataType = "String")
    private String address;

    /**
     * 预估重量
     */
    @ApiModelProperty(name = "forecastWeight",value = "预估重量",dataType = "BigDecimal")
    private BigDecimal forecastWeight;

    /**
     * 实际重量
     */
    @ApiModelProperty(name = "practicalWeight",value = "实际重量",dataType = "String")
    private String practicalWeight;

    /**
     * 实际重量搜索最大值
     */
    @ApiModelProperty(name = "practicalWeightEnd",value = "实际重量搜索最大值",dataType = "String")
    private String practicalWeightEnd;

    /**
     * 订单状态
     */
    @ApiModelProperty(name = "status",value = "订单状态",dataType = "String")
    private String status;

    /**
     * 拍照图片
     */
    @ApiModelProperty(name = "img",value = "拍照图片",dataType = "String")
    private String img;

    /**
     * 创建人
     */
    @ApiModelProperty(name = "createdBy",value = "创建人",dataType = "String")
    private String createdBy;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(name = "searchTimeBegin",value = "搜索开始时间",dataType = "Date",notes = "yyyy-MM-dd HH:mm:dd")
    private Date searchTimeBegin;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(name = "searchTimeEnd",value = "搜索结束时间",dataType = "Date",notes = "yyyy-MM-dd HH:mm:dd")
    private Date searchTimeEnd;

    @ApiModelProperty(name = "orderType",value = "订单类型（平台快递单/综合站订单）",dataType = "String")
    private String orderType;

    /**
     * 更新人
     */
    @ApiModelProperty(name = "updatedBy",value = "更新人",dataType = "String")
    private String updatedBy;

    /**
     * 更新时间
     */
    @ApiModelProperty(name = "integral",value = "积分",dataType = "INT")
    private Integer integral;

    @ApiModelProperty(name = "updatedTime",value = "更新时间",dataType = "Date",notes = "yyyy-MM-dd HH:mm:dd")
    private Date updatedTime;

    @ApiModelProperty(name = "currentPage", value = "当前页", dataType = "INT")
    private Integer currentPage = 1;

    @ApiModelProperty(name = "pageSize", value = "页码", dataType = "INT")
    private Integer pageSize = 10;

    @ApiModelProperty(name = "clientId", value = "客户ID", dataType = "Long")
    private Long clientId;
    @ApiModelProperty(name = "merchantId", value = "提供服务综合站ID")
    private Long merchantId;

    public void setSearchTimeEnd(Date searchEnd) {
        this.searchTimeEnd = DateUtil.offsetSecond(searchEnd, 86399).toJdkDate();

    }
}
